package cn.jeeweb.web.modules.common.controller;

import cn.jeeweb.common.annotate.UiPropertyField;
import cn.jeeweb.common.http.Response;
import cn.jeeweb.common.http.ResponseCode;
import cn.jeeweb.common.mvc.annotation.ViewPrefix;
import cn.jeeweb.common.mvc.controller.BaseController;
import cn.jeeweb.common.mybatis.mvc.service.ICommonService;
import cn.jeeweb.common.mybatis.mvc.wrapper.EntityWrapper;
import cn.jeeweb.common.query.annotation.RequestJsonParam;
import cn.jeeweb.common.query.data.Condition;
import cn.jeeweb.common.query.data.Page;
import cn.jeeweb.common.query.data.QueryRequest;
import cn.jeeweb.common.query.data.Queryable;
import cn.jeeweb.common.query.data.Queryable_XJ;
import cn.jeeweb.common.utils.SpringContextHolder;
import cn.jeeweb.common.utils.StringUtils;

import cn.jeeweb.web.modules.equipment.entity.*;
import cn.jeeweb.web.modules.equipment.service.*;
import cn.jeeweb.web.modules.master.service.impl.IMasterPipeStandardService;
import cn.jeeweb.web.modules.sys.entity.*;
import cn.jeeweb.web.utils.UserUtils;
import cn.xjzn.framework_Core.ModuleActionType;
import cn.xjzn.framework_Core.ModuleServe;
import cn.jeeweb.web.modules.sys.service.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Field;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @Title:
 * @Description: 公用控制器
 */
@Controller
@RestController
@RequestMapping("common")
@ViewPrefix("modules/common")
public class CommonController extends BaseController {
    @Autowired
    private IUserService userService;

    @Autowired
    private IRoleService roleService;

    @Autowired
    private IRoleMenuService roleMenuService;

    @Autowired
    private ISysConfigService sysConfigService;

    @Autowired
    private ISysLocationService sysLocationService;

    @Autowired
    private ISysUserConfigService sysUserConfigService;

    @Autowired
    private IOrganizationService organizationService;

    @Autowired
    private IDictGroupService dictGroupService;

    @Autowired
    private IMenuService menuService;

    @Autowired
    private IUiSearchSchemeService uiSearchSchemeService;
    @Autowired
    private IMasterPipeStandardService masterPipeStandardService;

    @Autowired
    private IEqsMaintenanceTaskService eqsMaintenanceTaskService;

    @Autowired
    private IEqsRepairRequistionService eqsRepairRequistionService;

    @Autowired
    private IUiPackageInfoService uiPackageInfoService;

    @Autowired
    ICodeTableService codeTableService;

    @Autowired
    IEqsMaintenanceCheckService eqsMaintenanceCheckService;

    @Autowired
    IEqsEquipmentService eqsEquipmentService;

    @Autowired
    IEqsMaintenancePlanService eqsMaintenancePlanService;

    @Autowired
    IEqsMaintenanceCheckTemplateService eqsMaintenanceCheckTemplateService;

    @Autowired
    IEqsFixtureService eqsFixtureService;

    @Autowired
    IEqsSparePartService eqsSparePartService;

    @Autowired
    private IEqsCheckService eqsCheckService;

    /**
     * 图标资源
     *
     * @return
     */
    @RequestMapping(value = "icons", method = RequestMethod.GET)
    public String list(Model model) {
        return display("icons");
    }

    @RequestMapping(value = "treeselect", method = RequestMethod.GET)
    public String treeselect(Model model, HttpServletRequest request) {
        model.addAttribute("url", request.getParameter("url")); // 树结构数据URL
        String multiselect = request.getParameter("multiselect");
        String chkboxType = request.getParameter("chkboxType");
        model.addAttribute("chkboxType", chkboxType); // 父子关联
        if (StringUtils.isEmpty(multiselect)) {
            multiselect = Boolean.TRUE + "";
        }
        model.addAttribute("multiselect", multiselect); // 是否多选
        String selectNodes = request.getParameter("selectNodes");
        model.addAttribute("selectNodes", selectNodes);// 默认值
        return display("treeselect");
    }

    /**
     * 通用处理方法
     *
     * @param moduleId
     * @param method
     * @param json，实体对象的json序列化字符串。注：Delete接口，只需要传ID值
     * @param query                                   3000 1300 1200 1500
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "general", method = {RequestMethod.POST, RequestMethod.GET})
    public Response GeneralMethod(@RequestParam(value = "moduleId", required = false) String moduleId, @RequestParam(value = "method", required = false) String method, @RequestParam(value = "json", required = false) String json, @RequestParam(value = "json_", required = false) String json_, @RequestJsonParam(required = false) Queryable_XJ query,
                                  @RequestParam(value = "actionCode", required = false) String actionCode,
                                  @RequestParam(value = "packageId", required = false) String packageId,
                                  @RequestParam(value = "foreignId", required = false) String foreignId,
                                  @RequestParam(value = "groupType", required = false) String groupType,
                                  HttpServletRequest request, HttpServletResponse response) {
        String entityName = "";
        String className_ = "";
        boolean result = true;
        if (StringUtils.isNotBlank(actionCode)) {
            actionCode = StringEscapeUtils.unescapeHtml(actionCode);
            JSONObject jsonObject = JSON.parseObject(actionCode);
            String className = jsonObject.getString("className");
            if (StringUtils.isNotBlank(className)) {
                entityName = className;
                result = false;
            } else {
                result = true;
            }
        }

        if (result) {
            if (StringUtils.isNotBlank(moduleId)) {
                ModuleServe moduleServe = ModuleServe.getEnumByValue(moduleId);
                if (moduleServe == null || moduleServe == ModuleServe.UNKNOWN) {
                    return Response.error("未知模块参数，需要提供moduleId！");
                }
                entityName = moduleServe.getEntityName();
            }

            if (StringUtils.isNotBlank(packageId)) {
                UiPackageInfo search = new UiPackageInfo();
                search.setId(packageId);
                UiPackageInfo uiPackageInfo = uiPackageInfoService.getUiPackageInfo(search);
                if (uiPackageInfo != null) {
                    String context = uiPackageInfo.getContext();
                    JSONObject jsonObject = JSON.parseObject(context);
                    String className = jsonObject.getString("className");
                    entityName = className;
                }
            }
            className_ = entityName;
            entityName = entityName.substring(entityName.lastIndexOf(".") + 1);
            String first = (entityName.charAt(0) + "").toLowerCase();
            entityName = first + entityName.substring(1);
        }
        ICommonService service = SpringContextHolder.getBean(entityName + "Service");
        if (service == null)
            return Response.error(ResponseCode.UNKNOWN_ERROR, "类没有注入成功:" + ICommonService.class.getName());

        ModuleActionType actionType = null;
        try {
            actionType = ModuleActionType.valueOf(method.toUpperCase());
        } catch (Exception e) {
            e.printStackTrace();
        }

        if (actionType == null) {
            //不能自动识别的处理，需要前后端一起移除这些约定
            switch (method) {
                case "add":
                    actionType = ModuleActionType.INSERT;
                    break;
                default:
                    actionType = null;
            }
        }
        json = StringEscapeUtils.unescapeHtml(json);
        //如果json中有code要根据配置进行自动编码
        if (StringUtils.isNotBlank(json)) {
            json = getCode(className_, json);
        }
        if (actionType != null) {//通用功能处理
            switch (actionType) {
                case INSERT:
                    //service.insert(json);
                    Object ret = null;
                    json_ = StringEscapeUtils.unescapeHtml(json_);
                    if (StringUtils.isNotBlank(json_) && JSON.parseObject(json_) != null && JSON.parseObject(json_).size() > 0) {
                        ret = service.insertAndSelect(json, json_);
                        if ("exist".equals(ret)) {
                            return Response.error("添加失败，编码code已存在，请换一个");
                        }
                    } else {
                        ret = service.insertAndSelect(json);
                        if ("exist".equals(ret)) {
                            return Response.error("添加失败，编码code已存在，请换一个");
                        }
                    }
                    return Response.ok("添加成功", ret);
                case UPDATE:
                    boolean operationResult = false;
                    json_ = StringEscapeUtils.unescapeHtml(json_);
                    if (StringUtils.isNotBlank(json_) && JSON.parseObject(json_) != null && JSON.parseObject(json_).size() > 0) {
                        json_ = StringEscapeUtils.unescapeHtml(json_);
                        operationResult = service.insertOrUpdate(json, json_);
                    } else {
                        operationResult = service.insertOrUpdate(json);
                    }
                    if (!operationResult) {
                        return Response.error("更新失败，编码code已存在,请换一个");
                    }
                    return Response.ok("更新成功");
                case DELETE:
                    service.deleteById(json);
                    return Response.ok("删除成功");
                case DELETEBATCH:
                    service.deleteBatchIds(json);
                    return Response.ok("删除成功");
                case GETBYID:
                    return Response.ok("", service.getById(json));
                case GETPAGELIST:
                    return Response.ok("获取成功", service.list(transferToQueryable(query)));
                case GETSPECIALPAGELIST:
                    return Response.ok("获取成功", service.list(transferToQueryable(query), "1", ""));
                case GETNOPAGELIST:
                    Map<String, List<Role>> map = new HashMap<String, List<Role>>();
                    map.put("content", service.listWithNoPage(transferToQueryable(query)));
                    return Response.ok("获取成功", map);
                case GETPAGESUBLIST:
                    return Response.ok("获取成功", service.list(transferToQueryable(query), "0", foreignId));
                case GETNOPAGESUBLIST:
                    Map<String, Object> map_ = new HashMap<String, Object>();
                    map_.put("content", service.listWithNoPage(transferToQueryable(query)));
                    return Response.ok("获取成功", map_);
                case SELECT:
                    break;
                case INSERTRELATIONTABLE:
                    service.insertRelationTable(json);
                    return Response.ok("保存成功");
                case UPDATERELATIONTABLE:
                    service.updateRelationTable(json);
                    return Response.ok("更新成功");
                case DELETERELATIONTABLE:
                    service.deleteRelationTable(json);
                    return Response.ok("删除成功");
                case EXPORT:
                    String title = getPackageTitle(packageId);
                    Page pageBean = service.list(transferToQueryable(query));
                    return service.export(pageBean, title);
                case IMPORT:
                    break;
                case PRINT:
                    break;
                case OTHER:
                default:
                    return Response.error("方法参数的处理逻辑未实现：" + actionType.name());
            }
        } else {
            //专用功能处理
            if ("getRoleList".equals(method)) {
                Queryable queryable = QueryRequest.newQueryable();
                queryable.addCondition("usable||eq", "1");
                List list = service.listWithNoPage(queryable);
                Map<String, List<Role>> map = new HashMap<String, List<Role>>();
                map.put("records", list);
                return Response.ok(null, map);
            } else if ("query".equals(method)) {
                Queryable queryRequest = JSON.parseObject(json, QueryRequest.class);
                queryRequest.setCondition(new Condition());
                System.out.println(queryRequest.toString());
            } else if ("getEqsTaskByPlanId".equals(method)) {//根据保养计划查询是否产生了任务。
                int code = 0;
                String msg = "";
                JSONObject jsonObject = JSON.parseObject(json);
                String planId = jsonObject.getString("id");
                EntityWrapper<EqsMaintenanceTask> maintenanceTaskEntityWrapper = new EntityWrapper<>(EqsMaintenanceTask.class);
                maintenanceTaskEntityWrapper.eq("planId", planId);
                List<EqsMaintenanceTask> list = eqsMaintenanceTaskService.selectList(maintenanceTaskEntityWrapper);
                if (list != null && list.size() > 0) {
                    code = ResponseCode.EXIST_CODE;
                    msg = "已生成任务";
                } else {
                    code = ResponseCode.NOT_EXIST_CODE;
                    msg = "未生成任务";
                }
                return Response.response(code, msg);
            } else if ("getEqsEquipmentPage".equals(method)) {
                Page page = service.list(transferToQueryable(query));
                List<EqsEquipment> list = page.getContent();
                if (list != null && list.size() > 0) {
                    for (EqsEquipment eqsEquipment : list) {
                        eqsEquipment.setCode("资产编号 " + eqsEquipment.getCode());
                        eqsEquipment.setAcc("供应商 " + eqsEquipment.getAcc());
                    }
                }
                return Response.ok("获取成功", page);
            } else if ("getEqsEquipmentByGroup".equals(method)) {
                if (ModuleServe.equipmentModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EntityWrapper<EqsEquipment> entityWrapper = new EntityWrapper<>(EqsEquipment.class);
                    entityWrapper.eq("id", id);
                    EqsEquipment eqsEquipment = eqsEquipmentService.getById(json);
                    DataVo baseDataVo = new DataVo();
                    List<DataVo> baseData = new ArrayList<DataVo>();//基础信息
                    DataVo assetsDataVo = new DataVo();
                    List<DataVo> assetsData = new ArrayList<DataVo>();//资产信息
                    DataVo supplierDataVo = new DataVo();
                    List<DataVo> supplierData = new ArrayList<DataVo>();//供应商信息
                    DataVo maintenanceDataVo = new DataVo();
                    List<DataVo> maintenanceData = new ArrayList<DataVo>();//维保信息
                    DataVo sparePartDataVo = new DataVo();
                    List<DataVo> sparePartData = new ArrayList<DataVo>();//设备关联的备件信息
                    DataVo otherDataVo = new DataVo();
                    List<DataVo> otherData = new ArrayList<DataVo>();//其它信息
                    if (eqsEquipment != null) {
                        //基础信息
                        String code = eqsEquipment.getCode();//编号
                        String name = eqsEquipment.getName();//名称
                        String brand = eqsEquipment.getBrand();//品牌
                        String model = eqsEquipment.getModel();//规格型号
                        String otherProp = eqsEquipment.getOtherProp();//其它属性
                        String organizationId = eqsEquipment.getOrganizationId();//机构id
                        String organizationCode = eqsEquipment.getOrganization() != null ? eqsEquipment.getOrganization().getCode() : "";
                        String organizationName = eqsEquipment.getOrganization() != null ? eqsEquipment.getOrganization().getName() : "";
                        String chargeby = eqsEquipment.getChargeby();//责任人
                        String devUseman = eqsEquipment.getDevUseman();//使用人
                        String locationCode = eqsEquipment.getLocationCode();//位置编号
                        String isSpecial = eqsEquipment.getIsSpecial();//是否特殊设备
                        String isSafeDevice = eqsEquipment.getIsSafeDevice();//是否安全装置
                        String remark = eqsEquipment.getRemarks();//描述

                        DataVo codeVo = initDataVo("资产编号", code, "code", "", "1", "", "", "", "");
                        DataVo nameVo = initDataVo("固定资产名称", name, "name", "", "1", "", "", "", "");
                        DataVo brandVo = initDataVo("品牌", brand, "brand", "", "1", "", "", "", "");
                        DataVo modelVo = initDataVo("规格型号", model, "model", "", "1", "", "", "", "");
                        DataVo otherPropVo = initDataVo("其它属性", otherProp, "otherProp", "", "1", "", "", "", "");
                        DataVo organizationIdVo = initDataVo("机构id", organizationId, "id", "organizationId", "0", "", "2", "10006", "");
                        DataVo organizationCodeVo = initDataVo("机构编码", organizationCode, "code", "code@organization", "1", "", "2", "10006", "");
                        DataVo organizationNameVo = initDataVo("机构名称", organizationName, "name", "name@organization", "1", "", "2", "10006", "");
                        DataVo chargebyVo = initDataVo("责任人", chargeby, "chargeby", "", "1", "", "", "", "");
                        DataVo devUsemanVo = initDataVo("使用人", devUseman, "devUseman", "", "1", "", "", "", "");
                        DataVo locationCodeVo = initDataVo("位置编号", locationCode, "locationCode", "", "1", "", "", "", "");
                        DataVo isSpecialVo = initDataVo("是否特殊设备", isSpecial, "isSpecial", "", "1", "", "1", "", "sf");
                        DataVo isSafeDeviceVo = initDataVo("是否安全装置", isSafeDevice, "isSafeDevice", "", "1", "", "1", "", "sf");
                        DataVo remarkVo = initDataVo("描述", remark, "remarks", "", "1", "", "", "", "");
                        baseData.add(codeVo);
                        baseData.add(nameVo);
                        baseData.add(brandVo);
                        baseData.add(modelVo);
                        baseData.add(otherPropVo);
                        baseData.add(organizationIdVo);
                        baseData.add(organizationCodeVo);
                        baseData.add(organizationNameVo);
                        baseData.add(chargebyVo);
                        baseData.add(devUsemanVo);
                        baseData.add(locationCodeVo);
                        baseData.add(isSpecialVo);
                        baseData.add(isSafeDeviceVo);
                        baseData.add(remarkVo);

                        //资产信息
                        String secCode = eqsEquipment.getSecCode();//财务编号
                        String kindCode = eqsEquipment.getKindCode();//资产分类代码
                        String totalfee = eqsEquipment.getTotalfee();//原值
                        String depreType = eqsEquipment.getDepreType();//折旧方法
                        String salvageValueRate = eqsEquipment.getSalvageValueRate();//预计净残值率
                        String preDepreciationMoon = eqsEquipment.getPreDepreciationMoon();//预计使用月份
                        Date maintenEndDate = eqsEquipment.getMaintenEndDate();//维修截止日期
                        Date rejectEndDate = eqsEquipment.getRejectEndDate();//报废截止日期
                        String devStatus = eqsEquipment.getDevStatus();//资产状态
                        String isDiscard = eqsEquipment.getIsDiscard();//是否已销账
                        Date discardDate = eqsEquipment.getDiscardDate();//销账日期
                        String discardType = eqsEquipment.getDiscardType();//销账类型
                        String currencyKind = eqsEquipment.getCurrencyKind();//货币种类
                        String costCenter = eqsEquipment.getCostCenter();//所属成本中心
                        String assetAttributes = eqsEquipment.getAssetAttributes();//资产属性

                        DataVo secCodeVo = initDataVo("财务编号", secCode, "secCode", "", "1", "", "", "", "");
                        DataVo kindCodeVo = initDataVo("资产分类代码", kindCode, "kindCode", "", "1", "", "", "", "");
                        DataVo totalfeeVo = initDataVo("原值", totalfee, "totalfee", "", "1", "", "", "", "");
                        DataVo depreTypeVo = initDataVo("折旧方法", depreType, "depreType", "", "1", "", "", "", "");
                        DataVo salvageValueRateVo = initDataVo("预计净残值率", salvageValueRate, "salvageValueRate", "", "1", "", "", "", "");
                        DataVo preDepreciationMoonVo = initDataVo("预计使用月份", preDepreciationMoon, "preDepreciationMoon", "", "1", "", "", "", "");
                        DataVo maintenEndDateVo = initDataVo("维修截止日期", maintenEndDate != null ? maintenEndDate.getTime() + "" : "", "maintenEndDate", "", "1", "", "3", "", "");
                        DataVo rejectEndDateVo = initDataVo("报废截止日期", rejectEndDate != null ? rejectEndDate.getTime() + "" : "", "rejectEndDate", "", "1", "", "3", "", "");
                        DataVo devStatusVo = initDataVo("资产状态", devStatus, "devStatus", "", "1", "", "", "", "");
                        DataVo isDiscardVo = initDataVo("是否已销账", isDiscard, "isDiscard", "", "1", "", "", "", "");
                        DataVo discardDateVo = initDataVo("报废截止日期", discardDate != null ? discardDate.getTime() + "" : "", "discardDate", "", "1", "", "3", "", "");
                        DataVo discardTypeVo = initDataVo("销账类型", discardType, "discardType", "", "1", "", "", "", "");
                        DataVo currencyKindVo = initDataVo("货币种类", currencyKind, "currencyKind", "", "1", "", "", "", "");
                        DataVo costCenterVo = initDataVo("所属成本中心", costCenter, "costCenter", "", "1", "", "", "", "");
                        DataVo assetAttributesVo = initDataVo("资产属性", assetAttributes, "assetAttributes", "", "1", "", "", "", "");
                        assetsData.add(secCodeVo);
                        assetsData.add(kindCodeVo);
                        assetsData.add(totalfeeVo);
                        assetsData.add(depreTypeVo);
                        assetsData.add(salvageValueRateVo);
                        assetsData.add(preDepreciationMoonVo);
                        assetsData.add(maintenEndDateVo);
                        assetsData.add(rejectEndDateVo);
                        assetsData.add(devStatusVo);
                        assetsData.add(isDiscardVo);
                        assetsData.add(discardDateVo);
                        assetsData.add(discardTypeVo);
                        assetsData.add(currencyKindVo);
                        assetsData.add(costCenterVo);
                        assetsData.add(assetAttributesVo);

                        //供应商信息
                        String fac = eqsEquipment.getFac();//生产商
                        String acc = eqsEquipment.getAcc();//供应商
                        Date stockDate = eqsEquipment.getStockDate();//采购日期
                        Date devDate = eqsEquipment.getDevDate();//生产日期
                        Double price = eqsEquipment.getPrice();//价格
                        Date arDate = eqsEquipment.getArDate();//建档日期
                        String buyContract = eqsEquipment.getBuyContract();//合同号
                        String buyPrs = eqsEquipment.getBuyPrs();//购买人
                        String devUse = eqsEquipment.getDevUse();//用途
                        String devSource = eqsEquipment.getDevSource();//设备来源

                        DataVo facVo = initDataVo("生产商", fac, "fac", "", "1", "", "", "", "");
                        DataVo accVo = initDataVo("供应商", acc, "acc", "", "1", "", "", "", "");
                        DataVo stockDateVo = initDataVo("采购日期", stockDate != null ? stockDate.getTime() + "" : "", "stockDate", "", "1", "", "3", "", "");
                        DataVo devDateVo = initDataVo("生产日期", devDate != null ? devDate.getTime() + "" : "", "devDate", "", "1", "", "3", "", "");
                        DataVo priceVo = initDataVo("价格", price != null ? Double.toString(price) : "", "price", "", "1", "", "", "", "");
                        DataVo arDateVo = initDataVo("建档日期", arDate != null ? arDate.getTime() + "" : "", "arDate", "", "1", "", "3", "", "");
                        DataVo buyContractVo = initDataVo("合同号", buyContract, "buyContract", "", "1", "", "", "", "");
                        DataVo buyPrsVo = initDataVo("购买人", buyPrs, "buyPrs", "", "1", "", "", "", "");
                        DataVo devUseVo = initDataVo("用途", devUse, "devUse", "", "1", "", "", "", "");
                        DataVo devSourceVo = initDataVo("设备来源", devSource, "devSource", "", "1", "", "", "", "");
                        supplierData.add(facVo);
                        supplierData.add(accVo);
                        supplierData.add(stockDateVo);
                        supplierData.add(devDateVo);
                        supplierData.add(priceVo);
                        supplierData.add(arDateVo);
                        supplierData.add(buyContractVo);
                        supplierData.add(buyPrsVo);
                        supplierData.add(devUseVo);
                        supplierData.add(devSourceVo);

                        EntityWrapper<EqsMaintenancePlan> eqsMaintenancePlanEntityWrapper = new EntityWrapper<>(EqsMaintenancePlan.class);
                        eqsMaintenancePlanEntityWrapper.eq("equipmentId", id);
                        EqsMaintenancePlan eqsMaintenancePlan = eqsMaintenancePlanService.selectOne(eqsMaintenancePlanEntityWrapper);
                        if (eqsMaintenancePlan != null) {
                            String freqUnit = eqsMaintenancePlan.getFreqUnit();//检修频率数
                            DataVo freqUnitVo = initDataVo("检修频率数", freqUnit, "freqUnit", "", "1", "", "1", "", "MaintenanceFreq");
                            maintenanceData.add(freqUnitVo);

                            EqsMaintenanceTask eqsMaintenanceTask = new EqsMaintenanceTask();
                            eqsMaintenanceTask.setPlanId(eqsMaintenancePlan.getId());
                            List<EqsMaintenanceTask> eqsMaintenanceTasks = eqsMaintenanceTaskService.getByTaskDate(eqsMaintenanceTask);
                            if (eqsMaintenanceTasks != null && eqsMaintenanceTasks.size() > 0) {
                                DataVo nextTaskDateVo = initDataVo("下次检修日期", eqsMaintenanceTasks.get(0).getTaskDate() != null ? eqsMaintenanceTasks.get(0).getTaskDate().getTime() + "" : "", "taskDate", "", "1", "", "3", "", "");
                                maintenanceData.add(nextTaskDateVo);
                            }
                        }

                        DataVo sparePartDataCodeVo = initDataVo("备件编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo sparePartDataNameVo = initDataVo("备件名称", "", "name", "", "1", "1", "0", "", "");
                        sparePartData.add(sparePartDataCodeVo);
                        sparePartData.add(sparePartDataNameVo);
                        sparePartDataVo.setLabelText("设备关联的备件信息");
                        sparePartDataVo.setVoList(sparePartData);
                        sparePartDataVo.setType("1");
                        sparePartDataVo.setOperationType("7");

                        baseDataVo.setLabelText("基础");
                        baseDataVo.setType("0");
                        baseDataVo.setVoList(baseData);
                        baseDataVo.setOperationType("");
                        assetsDataVo.setLabelText("资产");
                        assetsDataVo.setType("0");
                        assetsDataVo.setVoList(assetsData);
                        assetsDataVo.setOperationType("");
                        supplierDataVo.setLabelText("供应商信息");
                        supplierDataVo.setType("0");
                        supplierDataVo.setVoList(supplierData);
                        supplierDataVo.setOperationType("");
                        maintenanceDataVo.setLabelText("维保");
                        maintenanceDataVo.setType("0");
                        maintenanceDataVo.setVoList(maintenanceData);
                        maintenanceDataVo.setOperationType("");
                        maintenanceDataVo.setType("1");
                        maintenanceDataVo.setVoList(maintenanceData);
                        maintenanceDataVo.setOperationType("");
                        otherDataVo.setLabelText("其它");
                        otherDataVo.setType("0");
                        otherDataVo.setVoList(otherData);
                        otherDataVo.setOperationType("");
                        List<DataVo> dataVos = new ArrayList<>();
                        dataVos.add(baseDataVo);
                        dataVos.add(assetsDataVo);
                        dataVos.add(supplierDataVo);
                        dataVos.add(maintenanceDataVo);
                        dataVos.add(sparePartDataVo);
                        dataVos.add(otherDataVo);

                        Map resultMap = new HashMap<>();
                        resultMap.put("records", dataVos);
                        return Response.ok("", resultMap);
                    }
                } else if (ModuleServe.eqsMaintenancePlanModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EqsMaintenancePlan eqsMaintenancePlan = eqsMaintenancePlanService.getById(json);

                    DataVo baseDataVo = new DataVo();
                    List<DataVo> baseData = new ArrayList<DataVo>();//基础信息
                    DataVo planCheckTemplateDataVo = new DataVo();
                    List<DataVo> planCheckTemplateData = new ArrayList<DataVo>();//保养计划关联的点检模板
                    DataVo checkTemplateDataVo = new DataVo();
                    List<DataVo> checkTemplateData = new ArrayList<DataVo>();//点检模板信息
                    if (eqsMaintenancePlan != null) {
                        String code = eqsMaintenancePlan.getCode();
                        String name = eqsMaintenancePlan.getName();
                        String equipmentId = eqsMaintenancePlan.getEquipmentId();

                        EntityWrapper<EqsEquipment> entityWrapper = new EntityWrapper<>(EqsEquipment.class);
                        entityWrapper.eq("id", equipmentId);
                        EqsEquipment eqsEquipment = null;
                        String eqsEquipmentNameCode = "";
                        try {
                            eqsEquipment = eqsEquipmentService.selectOne(entityWrapper);
                            eqsEquipmentNameCode = eqsEquipment.getCode() + eqsEquipment.getName();
                        } catch (Exception e) {

                        }
                        String freqUnit = eqsMaintenancePlan.getFreqUnit();
                        String remarks = eqsMaintenancePlan.getRemarks();

                        DataVo codeVo = initDataVo("计划编号", code, "code", "", "1", "", "0", "", "");
                        DataVo nameVo = initDataVo("计划名称", name, "name", "", "1", "", "0", "", "");
                        DataVo eqsEquipmentNameCodeVo = initDataVo("资产编号+名称", eqsEquipmentNameCode, "", "", "1", "", "0", "", "");
                        DataVo freqUnitVo = initDataVo("保养频率数", freqUnit, "freqUnit", "", "1", "", "1", "", "MaintenanceFreq");
                        DataVo remarksVo = initDataVo("备注", remarks, "remarks", "", "1", "", "0", "", "");
                        baseData.add(codeVo);
                        baseData.add(nameVo);
                        baseData.add(eqsEquipmentNameCodeVo);
                        baseData.add(freqUnitVo);
                        baseData.add(remarksVo);
                        baseDataVo.setLabelText("保养计划基础信息");
                        baseDataVo.setType("0");
                        baseDataVo.setVoList(baseData);

                        DataVo planCheckCodeVo = initDataVo("模板编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo planCheckNameVo = initDataVo("模板名称", "", "name", "", "1", "1", "0", "", "");
                        planCheckTemplateData.add(planCheckCodeVo);
                        planCheckTemplateData.add(planCheckNameVo);
                        planCheckTemplateDataVo.setLabelText("保养计划关联的点检模板");
                        planCheckTemplateDataVo.setVoList(planCheckTemplateData);
                        planCheckTemplateDataVo.setType("1");
                        planCheckTemplateDataVo.setOperationType("1");

                        List<DataVo> dataVos = new ArrayList<DataVo>();
                        dataVos.add(baseDataVo);
                        dataVos.add(planCheckTemplateDataVo);
                        Map resultMap = new HashMap<>();
                        resultMap.put("records", dataVos);
                        return Response.ok("", resultMap);
                    }
                } else if (ModuleServe.eqsMaintenanceTaskModule.getValue().equals(moduleId)) {
                    EqsMaintenanceTask eqsMaintenanceTask = eqsMaintenanceTaskService.getById(json);
                    DataVo baseDataVo = new DataVo();
                    List<DataVo> baseData = new ArrayList<DataVo>();//基础信息

                    DataVo checkDataVo = new DataVo();
                    List<DataVo> checkData = new ArrayList<DataVo>();//点检信息
                    if (eqsMaintenanceTask != null) {
                        String planId = eqsMaintenanceTask.getPlanId();
                        EntityWrapper<EqsMaintenancePlan> eqsMaintenancePlanEntityWrapper = new EntityWrapper<>(EqsMaintenancePlan.class);
                        eqsMaintenancePlanEntityWrapper.eq("id", planId);
                        EqsMaintenancePlan eqsMaintenancePlan = eqsMaintenancePlanService.selectOne(eqsMaintenancePlanEntityWrapper);
                        String planCode = "";
                        if (eqsMaintenancePlan != null) {
                            planCode = eqsMaintenancePlan.getCode();
                        }
                        String code = eqsMaintenanceTask.getCode();
                        String name = eqsMaintenanceTask.getName();
                        String status = eqsMaintenanceTask.getStatus();
                        String equipmentId = eqsMaintenanceTask.getEquipmentId();
                        EntityWrapper<EqsEquipment> entityWrapper = new EntityWrapper<>(EqsEquipment.class);
                        entityWrapper.eq("id", equipmentId);
                        EqsEquipment eqsEquipment = null;
                        String eqsEquipmentNameCode = "";
                        try {
                            eqsEquipment = eqsEquipmentService.selectOne(entityWrapper);
                            eqsEquipmentNameCode = eqsEquipment.getCode() + eqsEquipment.getName();
                        } catch (Exception e) {

                        }
                        Date taskDate = eqsMaintenanceTask.getTaskDate();
                        String executor = eqsMaintenanceTask.getExecutor();
                        String executorId = eqsMaintenanceTask.getExecutorId();
                        String userCodeName = "";
                        EntityWrapper<User> userEntityWrapper = new EntityWrapper<>(User.class);
                        userEntityWrapper.eq("id", executorId);
                        User user = null;
                        try {
                            user = userService.selectOne(userEntityWrapper);
                            userCodeName = executor + user.getCode();
                        } catch (Exception e) {

                        }

                        String remarks = eqsMaintenanceTask.getRemarks();

                        DataVo planCodeVo = initDataVo("计划编号", planCode, "planCode", "", "1", "", "0", "", "");
                        DataVo codeVo = initDataVo("任务编号", code, "code", "", "1", "", "0", "", "");
                        DataVo nameVo = initDataVo("任务名称", name, "name", "", "1", "", "0", "", "");
                        DataVo statusVo = initDataVo("任务状态", status, "status", "", "1", "", "1", "", "MaintenanceTaskStatus");
                        DataVo eqsEquipmentNameCodeVo = initDataVo("任务名称", eqsEquipmentNameCode, "eqsEquipmentNameCode", "", "1", "", "0", "", "");
                        DataVo taskDateVo = initDataVo("任务开始日期", taskDate != null ? taskDate.getTime() + "" : "", "taskDate", "", "1", "", "3", "", "");
                        DataVo userCodeNameVo = initDataVo("保养人工号+姓名", userCodeName, "userCodeName", "", "1", "", "0", "", "");
                        DataVo remarksVo = initDataVo("备注", remarks, "remarks", "", "1", "", "0", "", "");

                        baseData.add(planCodeVo);
                        baseData.add(codeVo);
                        baseData.add(nameVo);
                        baseData.add(statusVo);
                        baseData.add(eqsEquipmentNameCodeVo);
                        baseData.add(taskDateVo);
                        baseData.add(userCodeNameVo);
                        baseData.add(remarksVo);
                        baseDataVo.setLabelText("任务信息");
                        baseDataVo.setOperationType("3");
                        baseDataVo.setType("0");
                        baseDataVo.setVoList(baseData);

                        DataVo checkCodeVo = initDataVo("模板编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo personInChargeNameVo = initDataVo("负责人", "", "personInChargeName", "", "1", "1", "0", "", "");
                        checkData.add(checkCodeVo);
                        checkData.add(personInChargeNameVo);
                        checkDataVo.setLabelText("点检信息");
                        checkDataVo.setType("1");
                        checkDataVo.setVoList(checkData);
                        checkDataVo.setOperationType("3");
                        List<DataVo> dataVos = new ArrayList<DataVo>();
                        dataVos.add(baseDataVo);
                        dataVos.add(checkDataVo);
                        Map resultMap = new HashMap<>();
                        resultMap.put("records", dataVos);
                        return Response.ok("", resultMap);
                    }

                } else if (ModuleServe.eqsFixtureModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EntityWrapper<EqsFixture> entityWrapper = new EntityWrapper<>(EqsFixture.class);
                    entityWrapper.eq("id", id);
                    EqsFixture eqsFixture = eqsFixtureService.getById(json);
                    List<DataVo> dataVos = new ArrayList<>();
                    DataVo baseDataVo = new DataVo();
                    List<DataVo> baseData = new ArrayList<DataVo>();//基础信息
                    DataVo assetsDataVo = new DataVo();
                    List<DataVo> assetsData = new ArrayList<DataVo>();//资产信息
                    DataVo supplierDataVo = new DataVo();
                    List<DataVo> supplierData = new ArrayList<DataVo>();//供应商信息
                    DataVo paperFileDataVo = new DataVo();
                    List<DataVo> paperFileData = new ArrayList<DataVo>();//图纸信息
                    DataVo equipmentDataVo = new DataVo();
                    List<DataVo> equipmentData = new ArrayList<DataVo>();//设备信息
                    DataVo fixtureDataVo = new DataVo();
                    List<DataVo> fixtureData = new ArrayList<DataVo>();//设备信息
                    DataVo otherDataVo = new DataVo();
                    List<DataVo> otherData = new ArrayList<DataVo>();//其它信息
                    if (eqsFixture != null) {
                        //基础信息
                        String code = eqsFixture.getCode();//工装编号
                        String locationCode = eqsFixture.getLocationCode();//库位编号
                        String price = eqsFixture.getPrice() == null ? "":eqsFixture.getPrice().toString();//单价
                        String importance = eqsFixture.getImportance();//重要性
                        String fixtureCatalogCode = eqsFixture.getFixtureCatalogCode();//工装类别
                        String minSafeStock = eqsFixture.getMinSafeStock() == null?"":eqsFixture.getMinSafeStock().toString();//最低安全库存
                        String repairCount = eqsFixture.getRepairCount() == null?"":eqsFixture.getRepairCount().toString();//报修工装数量
                        String inUseCount = eqsFixture.getInUseCount() == null?"":eqsFixture.getInUseCount().toString();//在用工装数量
                        String inLineSpareCount = eqsFixture.getInLineSpareCount() == null?"":eqsFixture.getInLineSpareCount().toString();//在线备用工装数量
                        String warehouseCount = eqsFixture.getWarehouseCount()== null?"":eqsFixture.getWarehouseCount().toString();//仓库工装数量
                        String fixtureStatus = eqsFixture.getFixtureStatus();//工装状态
                        String checkFreq = eqsFixture.getCheckFreq();//验证周期
                        String checkContent = eqsFixture.getCheckContent();//验证内容
                        String remark = eqsFixture.getRemarks();//描述

                        DataVo codeVo = initDataVo("工装编号", code, "code", "", "1", "", "", "", "");
                        DataVo locationCodeVo = initDataVo("库位编号", locationCode, "locationCode", "", "1", "", "", "", "");
                        DataVo priceVo = initDataVo("单价", price, "price", "", "1", "", "", "", "");
                        DataVo importanceVo = initDataVo("重要性", importance, "importance", "", "1", "", "", "", "");
                        DataVo fixtureCatalogCodeVo = initDataVo("工装类别", fixtureCatalogCode, "fixtureCatalogCode", "", "1", "", "1", "", "fixtureCatalogCode");
                        DataVo minSafeStockVo = initDataVo("最低安全库存", minSafeStock, "minSafeStock", "", "1", "", "", "", "");
                        DataVo repairCountVo = initDataVo("报修工装数量", repairCount, "repairCount", "", "1", "", "", "", "");
                        DataVo inUseCountVo = initDataVo("在用工装数量", inUseCount, "inUseCount", "", "1", "", "", "", "");
                        DataVo inLineSpareCountVo = initDataVo("在线备用工装数量", inLineSpareCount, "inLineSpareCount", "", "1", "", "", "", "");
                        DataVo warehouseCountVo = initDataVo("仓库工装数量", warehouseCount, "warehouseCount", "", "1", "", "", "", "");
                        DataVo fixtureStatusVo = initDataVo("工装状态", fixtureStatus, "fixtureStatus", "", "1", "", "1", "", "fixtureStatus");
                        DataVo checkFreqVo = initDataVo("验证周期", checkFreq, "checkFreq", "", "1", "", "1", "", "checkFreq");
                        DataVo checkContentVo = initDataVo("验证内容", checkContent, "checkContent", "", "1", "", "", "", "");
                        DataVo remarkVo = initDataVo("描述", remark, "remarks", "", "1", "", "", "", "");
                        baseData.add(codeVo);
                        baseData.add(locationCodeVo);
                        baseData.add(priceVo);
                        baseData.add(importanceVo);
                        baseData.add(fixtureCatalogCodeVo);
                        baseData.add(minSafeStockVo);
                        baseData.add(repairCountVo);
                        baseData.add(inUseCountVo);
                        baseData.add(inLineSpareCountVo);
                        baseData.add(warehouseCountVo);
                        baseData.add(fixtureStatusVo);
                        baseData.add(checkFreqVo);
                        baseData.add(checkContentVo);
                        baseData.add(remarkVo);

                        //资产信息
                        String secCode = eqsFixture.getSecCode();//财务编号
                        String kindCode = eqsFixture.getKindCode();//资产分类代码
                        String totalfee = eqsFixture.getTotalfee();//原值
                        String depreType = eqsFixture.getDepreType();//折旧方法
                        String salvageValueRate = eqsFixture.getSalvageValueRate();//预计净残值率
                        String preDepreciationMoon = eqsFixture.getPreDepreciationMoon();//预计使用月份
                        Date maintenEndDate = eqsFixture.getMaintenEndDate();//维修截止日期
                        Date rejectEndDate = eqsFixture.getRejectEndDate();//报废截止日期
                        String devStatus = eqsFixture.getDevStatus();//资产状态
                        String isDiscard = eqsFixture.getIsDiscard();//是否已销账
                        Date discardDate = eqsFixture.getDiscardDate();//销账日期
                        String discardType = eqsFixture.getDiscardType();//销账类型
                        String currencyKind = eqsFixture.getCurrencyKind();//货币种类
                        String costCenter = eqsFixture.getCostCenter();//所属成本中心
                        String assetAttributes = eqsFixture.getAssetAttributes();//资产属性

                        DataVo secCodeVo = initDataVo("财务编号", secCode, "secCode", "", "1", "", "", "", "");
                        DataVo kindCodeVo = initDataVo("资产分类代码", kindCode, "kindCode", "", "1", "", "", "", "");
                        DataVo totalfeeVo = initDataVo("原值", totalfee, "totalfee", "", "1", "", "", "", "");
                        DataVo depreTypeVo = initDataVo("折旧方法", depreType, "depreType", "", "1", "", "", "", "");
                        DataVo salvageValueRateVo = initDataVo("预计净残值率", salvageValueRate, "salvageValueRate", "", "1", "", "", "", "");
                        DataVo preDepreciationMoonVo = initDataVo("预计使用月份", preDepreciationMoon, "preDepreciationMoon", "", "1", "", "", "", "");
                        DataVo maintenEndDateVo = initDataVo("维修截止日期", maintenEndDate != null ? maintenEndDate.getTime() + "" : "", "maintenEndDate", "", "1", "", "3", "", "");
                        DataVo rejectEndDateVo = initDataVo("报废截止日期", rejectEndDate != null ? rejectEndDate.getTime() + "" : "", "rejectEndDate", "", "1", "", "3", "", "");
                        DataVo devStatusVo = initDataVo("资产状态", devStatus, "devStatus", "", "1", "", "", "", "");
                        DataVo isDiscardVo = initDataVo("是否已销账", isDiscard, "isDiscard", "", "1", "", "", "", "");
                        DataVo discardDateVo = initDataVo("报废截止日期", discardDate != null ? discardDate.getTime() + "" : "", "discardDate", "", "1", "", "3", "", "");
                        DataVo discardTypeVo = initDataVo("销账类型", discardType, "discardType", "", "1", "", "", "", "");
                        DataVo currencyKindVo = initDataVo("货币种类", currencyKind, "currencyKind", "", "1", "", "", "", "");
                        DataVo costCenterVo = initDataVo("所属成本中心", costCenter, "costCenter", "", "1", "", "", "", "");
                        DataVo assetAttributesVo = initDataVo("资产属性", assetAttributes, "assetAttributes", "", "1", "", "", "", "");
                        assetsData.add(secCodeVo);
                        assetsData.add(kindCodeVo);
                        assetsData.add(totalfeeVo);
                        assetsData.add(depreTypeVo);
                        assetsData.add(salvageValueRateVo);
                        assetsData.add(preDepreciationMoonVo);
                        assetsData.add(maintenEndDateVo);
                        assetsData.add(rejectEndDateVo);
                        assetsData.add(devStatusVo);
                        assetsData.add(isDiscardVo);
                        assetsData.add(discardDateVo);
                        assetsData.add(discardTypeVo);
                        assetsData.add(currencyKindVo);
                        assetsData.add(costCenterVo);
                        assetsData.add(assetAttributesVo);

                        //供应商信息
                        String fac = eqsFixture.getFac();//生产商
                        String acc = eqsFixture.getAcc();//供应商
                        Date stockDate = eqsFixture.getStockDate();//采购日期
                        Date devDate = eqsFixture.getDevDate();//生产日期
                        Date arDate = eqsFixture.getArDate();//建档日期
                        String buyContract = eqsFixture.getBuyContract();//合同号
                        String buyPrs = eqsFixture.getBuyPrs();//购买人
                        String devUse = eqsFixture.getDevUse();//用途
                        String devSource = eqsFixture.getDevSource();//设备来源

                        DataVo facVo = initDataVo("生产商", fac, "fac", "", "1", "", "", "", "");
                        DataVo accVo = initDataVo("供应商", acc, "acc", "", "1", "", "", "", "");
                        DataVo stockDateVo = initDataVo("采购日期", stockDate != null ? stockDate.getTime() + "" : "", "stockDate", "", "1", "", "3", "", "");
                        DataVo devDateVo = initDataVo("生产日期", devDate != null ? devDate.getTime() + "" : "", "devDate", "", "1", "", "3", "", "");
                        DataVo arDateVo = initDataVo("建档日期", arDate != null ? arDate.getTime() + "" : "", "arDate", "", "1", "", "3", "", "");
                        DataVo buyContractVo = initDataVo("合同号", buyContract, "buyContract", "", "1", "", "", "", "");
                        DataVo buyPrsVo = initDataVo("购买人", buyPrs, "buyPrs", "", "1", "", "", "", "");
                        DataVo devUseVo = initDataVo("用途", devUse, "devUse", "", "1", "", "", "", "");
                        DataVo devSourceVo = initDataVo("设备来源", devSource, "devSource", "", "1", "", "", "", "");
                        supplierData.add(facVo);
                        supplierData.add(accVo);
                        supplierData.add(stockDateVo);
                        supplierData.add(devDateVo);
                        supplierData.add(priceVo);
                        supplierData.add(arDateVo);
                        supplierData.add(buyContractVo);
                        supplierData.add(buyPrsVo);
                        supplierData.add(devUseVo);
                        supplierData.add(devSourceVo);

                        //图纸信息
                        String paperFile = eqsFixture.getPaperFile();
                        DataVo paperFileVo = initDataVo("图纸", paperFile, "paperFile", "", "1", "", "", "", "");
                        paperFileData.add(paperFileVo);

                        //关联设备信息
                        DataVo equipmentCodeVo = initDataVo("设备编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo equipmentNameVo = initDataVo("设备名称", "", "name", "", "1", "1", "0", "", "");
                        equipmentData.add(equipmentCodeVo);
                        equipmentData.add(equipmentNameVo);
                        equipmentDataVo.setLabelText("工装关联的设备信息");
                        equipmentDataVo.setVoList(equipmentData);
                        equipmentDataVo.setType("1");
                        equipmentDataVo.setOperationType("4");

                        //工装替换信息
                        DataVo fixtureCodeVo = initDataVo("工装编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo fixtureNameVo = initDataVo("工装名称", "", "name", "", "1", "1", "0", "", "");
                        fixtureData.add(fixtureCodeVo);
                        fixtureData.add(fixtureNameVo);
                        fixtureDataVo.setLabelText("工装替换信息");
                        fixtureDataVo.setVoList(fixtureData);
                        fixtureDataVo.setType("1");
                        fixtureDataVo.setOperationType("5");

                        baseDataVo.setLabelText("基础");
                        baseDataVo.setType("0");
                        baseDataVo.setVoList(baseData);
                        baseDataVo.setOperationType("");
                        assetsDataVo.setLabelText("资产");
                        assetsDataVo.setType("0");
                        assetsDataVo.setVoList(assetsData);
                        assetsDataVo.setOperationType("");
                        supplierDataVo.setLabelText("供应商信息");
                        supplierDataVo.setType("0");
                        supplierDataVo.setVoList(supplierData);
                        supplierDataVo.setOperationType("");
                        paperFileDataVo.setLabelText("图纸");
                        paperFileDataVo.setType("2");
                        paperFileDataVo.setVoList(paperFileData);
                        paperFileDataVo.setOperationType("");
                        otherDataVo.setLabelText("其它");
                        otherDataVo.setType("0");
                        otherDataVo.setVoList(otherData);
                        otherDataVo.setOperationType("");
                        dataVos.add(baseDataVo);
                        dataVos.add(assetsDataVo);
                        dataVos.add(supplierDataVo);
                        dataVos.add(paperFileDataVo);
                        dataVos.add(equipmentDataVo);
                        dataVos.add(fixtureDataVo);
                        dataVos.add(otherDataVo);

                        Map resultMap = new HashMap<>();
                        resultMap.put("records", dataVos);
                        return Response.ok("", resultMap);
                    }
                } else if (ModuleServe.eqsFixtureRefModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EntityWrapper<EqsFixture> entityWrapper = new EntityWrapper<>(EqsFixture.class);
                    entityWrapper.eq("id", id);
                    EqsFixture eqsFixture = eqsFixtureService.getById(json);
                    List<DataVo> dataVos = new ArrayList<>();
                    DataVo applyDataVo = new DataVo();
                    List<DataVo> applyData = new ArrayList<DataVo>();//申请
                    if (eqsFixture != null) {
                        //申请信息
                        String fixtureCode = eqsFixture.getCode();//工装编号
                        String locationCode = eqsFixture.getLocationCode();//库位编号
                        String qualityCode = eqsFixture.getQualityCode();//质检报告编码

                        DataVo fixtureCodeVo = initDataVo("工装编号", fixtureCode, "fixtureCode", "", "1", "", "", "", "");
                        DataVo locationCodeVo = initDataVo("库位编号", locationCode, "locationCode", "", "1", "", "", "", "");
                        DataVo applyNumberVo = initDataVo("数量", "", "applyNumber", "", "1", "", "", "", "");
                        DataVo qualityCodeVo = initDataVo("质检报告编码", qualityCode, "qualityCode", "", "1", "", "", "", "");
                        DataVo applyDateVo = initDataVo("申请时间", "", "applyDate", "", "1", "", "3", "", "");
                        DataVo applyTypeVo = initDataVo("申请类型", "", "applyType", "", "1", "", "1", "", "OperateApplyType");
                        applyData.add(fixtureCodeVo);
                        applyData.add(locationCodeVo);
                        applyData.add(applyNumberVo);
                        applyData.add(qualityCodeVo);
                        applyData.add(applyDateVo);
                        applyData.add(applyTypeVo);

                        applyDataVo.setLabelText("操作申请");
                        applyDataVo.setType("0");
                        applyDataVo.setVoList(applyData);
                        applyDataVo.setOperationType("6");
                        dataVos.add(applyDataVo);
                    }
                    Map resultMap = new HashMap<>();
                    resultMap.put("records", dataVos);
                    return Response.ok("", resultMap);
                }else if (ModuleServe.eqsSparePartModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EntityWrapper<EqsSparePart> entityWrapper = new EntityWrapper<>(EqsSparePart.class);
                    entityWrapper.eq("id", id);
                    EqsSparePart eqsSparePart = eqsSparePartService.getById(json);
                    List<DataVo> dataVos = new ArrayList<>();
                    DataVo baseDataVo = new DataVo();
                    List<DataVo> baseData = new ArrayList<DataVo>();//基础信息
                    DataVo assetsDataVo = new DataVo();
                    List<DataVo> assetsData = new ArrayList<DataVo>();//资产信息
                    DataVo supplierDataVo = new DataVo();
                    List<DataVo> supplierData = new ArrayList<DataVo>();//供应商信息
                    DataVo paperFileDataVo = new DataVo();
                    List<DataVo> paperFileData = new ArrayList<DataVo>();//图纸信息
                    DataVo equipmentDataVo = new DataVo();
                    List<DataVo> equipmentData = new ArrayList<DataVo>();//设备信息
                    DataVo fixtureDataVo = new DataVo();
                    List<DataVo> fixtureData = new ArrayList<DataVo>();//设备信息
                    DataVo otherDataVo = new DataVo();
                    List<DataVo> otherData = new ArrayList<DataVo>();//其它信息
                    if (eqsSparePart != null) {
                        //基础信息
                        String code = eqsSparePart.getCode();//编号
                        String locationCode = eqsSparePart.getLocationCode();//库位编号
                        String price = eqsSparePart.getPrice() == null ? "":eqsSparePart.getPrice().toString();//单价
                        String importance = eqsSparePart.getImportance();//重要性
                        String spareCatalogCode = eqsSparePart.getSpareCatalogCode();//类别
                        String minSafeStock = eqsSparePart.getMinSafeStock() == null?"":eqsSparePart.getMinSafeStock().toString();//最低安全库存
                        String warehouseCount = eqsSparePart.getWarehouseCount()== null?"":eqsSparePart.getWarehouseCount().toString();//仓库工装数量
                        String status = eqsSparePart.getStatus();//状态
                        String checkFreq = eqsSparePart.getCheckFreq();//验证周期
                        String remark = eqsSparePart.getRemarks();//描述

                        DataVo codeVo = initDataVo("备件编号", code, "code", "", "1", "", "", "", "");
                        DataVo locationCodeVo = initDataVo("库位编号", locationCode, "locationCode", "", "1", "", "", "", "");
                        DataVo priceVo = initDataVo("单价", price, "price", "", "1", "", "", "", "");
                        DataVo importanceVo = initDataVo("重要性", importance, "importance", "", "1", "", "", "", "");
                        DataVo spareCatalogCodeVo = initDataVo("备件类别", spareCatalogCode, "spareCatalogCode", "", "1", "", "1", "", "spareCatalogCode");
                        DataVo minSafeStockVo = initDataVo("最低安全库存", minSafeStock, "minSafeStock", "", "1", "", "", "", "");
                        DataVo warehouseCountVo = initDataVo("仓库工装数量", warehouseCount, "warehouseCount", "", "1", "", "", "", "");
                        DataVo statusVo = initDataVo("备件状态", status, "status", "", "1", "", "1", "", "sparePartStatus");
                        DataVo checkFreqVo = initDataVo("验证周期", checkFreq, "checkFreq", "", "1", "", "1", "", "checkFreq");
                        DataVo remarkVo = initDataVo("描述", remark, "remarks", "", "1", "", "", "", "");
                        baseData.add(codeVo);
                        baseData.add(locationCodeVo);
                        baseData.add(priceVo);
                        baseData.add(importanceVo);
                        baseData.add(spareCatalogCodeVo);
                        baseData.add(minSafeStockVo);
                        baseData.add(warehouseCountVo);
                        baseData.add(statusVo);
                        baseData.add(checkFreqVo);
                        baseData.add(remarkVo);

                        //资产信息
                        String secCode = eqsSparePart.getSecCode();//财务编号
                        String kindCode = eqsSparePart.getKindCode();//资产分类代码
                        String totalfee = eqsSparePart.getTotalfee();//原值
                        String depreType = eqsSparePart.getDepreType();//折旧方法
                        String salvageValueRate = eqsSparePart.getSalvageValueRate();//预计净残值率
                        String preDepreciationMoon = eqsSparePart.getPreDepreciationMoon();//预计使用月份
                        Date maintenEndDate = eqsSparePart.getMaintenEndDate();//维修截止日期
                        Date rejectEndDate = eqsSparePart.getRejectEndDate();//报废截止日期
                        String devStatus = eqsSparePart.getDevStatus();//资产状态
                        String isDiscard = eqsSparePart.getIsDiscard();//是否已销账
                        Date discardDate = eqsSparePart.getDiscardDate();//销账日期
                        String discardType = eqsSparePart.getDiscardType();//销账类型
                        String currencyKind = eqsSparePart.getCurrencyKind();//货币种类
                        String costCenter = eqsSparePart.getCostCenter();//所属成本中心
                        String assetAttributes = eqsSparePart.getAssetAttributes();//资产属性

                        DataVo secCodeVo = initDataVo("财务编号", secCode, "secCode", "", "1", "", "", "", "");
                        DataVo kindCodeVo = initDataVo("资产分类代码", kindCode, "kindCode", "", "1", "", "", "", "");
                        DataVo totalfeeVo = initDataVo("原值", totalfee, "totalfee", "", "1", "", "", "", "");
                        DataVo depreTypeVo = initDataVo("折旧方法", depreType, "depreType", "", "1", "", "", "", "");
                        DataVo salvageValueRateVo = initDataVo("预计净残值率", salvageValueRate, "salvageValueRate", "", "1", "", "", "", "");
                        DataVo preDepreciationMoonVo = initDataVo("预计使用月份", preDepreciationMoon, "preDepreciationMoon", "", "1", "", "", "", "");
                        DataVo maintenEndDateVo = initDataVo("维修截止日期", maintenEndDate != null ? maintenEndDate.getTime() + "" : "", "maintenEndDate", "", "1", "", "3", "", "");
                        DataVo rejectEndDateVo = initDataVo("报废截止日期", rejectEndDate != null ? rejectEndDate.getTime() + "" : "", "rejectEndDate", "", "1", "", "3", "", "");
                        DataVo devStatusVo = initDataVo("资产状态", devStatus, "devStatus", "", "1", "", "", "", "");
                        DataVo isDiscardVo = initDataVo("是否已销账", isDiscard, "isDiscard", "", "1", "", "", "", "");
                        DataVo discardDateVo = initDataVo("报废截止日期", discardDate != null ? discardDate.getTime() + "" : "", "discardDate", "", "1", "", "3", "", "");
                        DataVo discardTypeVo = initDataVo("销账类型", discardType, "discardType", "", "1", "", "", "", "");
                        DataVo currencyKindVo = initDataVo("货币种类", currencyKind, "currencyKind", "", "1", "", "", "", "");
                        DataVo costCenterVo = initDataVo("所属成本中心", costCenter, "costCenter", "", "1", "", "", "", "");
                        DataVo assetAttributesVo = initDataVo("资产属性", assetAttributes, "assetAttributes", "", "1", "", "", "", "");
                        assetsData.add(secCodeVo);
                        assetsData.add(kindCodeVo);
                        assetsData.add(totalfeeVo);
                        assetsData.add(depreTypeVo);
                        assetsData.add(salvageValueRateVo);
                        assetsData.add(preDepreciationMoonVo);
                        assetsData.add(maintenEndDateVo);
                        assetsData.add(rejectEndDateVo);
                        assetsData.add(devStatusVo);
                        assetsData.add(isDiscardVo);
                        assetsData.add(discardDateVo);
                        assetsData.add(discardTypeVo);
                        assetsData.add(currencyKindVo);
                        assetsData.add(costCenterVo);
                        assetsData.add(assetAttributesVo);

                        //供应商信息
                        String fac = eqsSparePart.getFac();//生产商
                        String acc = eqsSparePart.getAcc();//供应商
                        Date stockDate = eqsSparePart.getStockDate();//采购日期
                        Date devDate = eqsSparePart.getDevDate();//生产日期
                        Date arDate = eqsSparePart.getArDate();//建档日期
                        String buyContract = eqsSparePart.getBuyContract();//合同号
                        String buyPrs = eqsSparePart.getBuyPrs();//购买人
                        String devUse = eqsSparePart.getDevUse();//用途
                        String devSource = eqsSparePart.getDevSource();//设备来源

                        DataVo facVo = initDataVo("生产商", fac, "fac", "", "1", "", "", "", "");
                        DataVo accVo = initDataVo("供应商", acc, "acc", "", "1", "", "", "", "");
                        DataVo stockDateVo = initDataVo("采购日期", stockDate != null ? stockDate.getTime() + "" : "", "stockDate", "", "1", "", "3", "", "");
                        DataVo devDateVo = initDataVo("生产日期", devDate != null ? devDate.getTime() + "" : "", "devDate", "", "1", "", "3", "", "");
                        DataVo arDateVo = initDataVo("建档日期", arDate != null ? arDate.getTime() + "" : "", "arDate", "", "1", "", "3", "", "");
                        DataVo buyContractVo = initDataVo("合同号", buyContract, "buyContract", "", "1", "", "", "", "");
                        DataVo buyPrsVo = initDataVo("购买人", buyPrs, "buyPrs", "", "1", "", "", "", "");
                        DataVo devUseVo = initDataVo("用途", devUse, "devUse", "", "1", "", "", "", "");
                        DataVo devSourceVo = initDataVo("设备来源", devSource, "devSource", "", "1", "", "", "", "");
                        supplierData.add(facVo);
                        supplierData.add(accVo);
                        supplierData.add(stockDateVo);
                        supplierData.add(devDateVo);
                        supplierData.add(priceVo);
                        supplierData.add(arDateVo);
                        supplierData.add(buyContractVo);
                        supplierData.add(buyPrsVo);
                        supplierData.add(devUseVo);
                        supplierData.add(devSourceVo);

                        //图纸信息
                        String paperFile = eqsSparePart.getPaperFile();
                        DataVo paperFileVo = initDataVo("图纸", paperFile, "paperFile", "", "1", "", "", "", "");
                        paperFileData.add(paperFileVo);

                        //关联设备信息
                        DataVo equipmentCodeVo = initDataVo("设备编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo equipmentNameVo = initDataVo("设备名称", "", "name", "", "1", "1", "0", "", "");
                        equipmentData.add(equipmentCodeVo);
                        equipmentData.add(equipmentNameVo);
                        equipmentDataVo.setLabelText("备件关联的设备信息");
                        equipmentDataVo.setVoList(equipmentData);
                        equipmentDataVo.setType("1");
                        equipmentDataVo.setOperationType("4");

                        //工装替换信息
                        DataVo fixtureCodeVo = initDataVo("备件编号", "", "code", "", "1", "1", "0", "", "");
                        DataVo fixtureNameVo = initDataVo("备件名称", "", "name", "", "1", "1", "0", "", "");
                        fixtureData.add(fixtureCodeVo);
                        fixtureData.add(fixtureNameVo);
                        fixtureDataVo.setLabelText("备件替换信息");
                        fixtureDataVo.setVoList(fixtureData);
                        fixtureDataVo.setType("1");
                        fixtureDataVo.setOperationType("5");

                        baseDataVo.setLabelText("基础");
                        baseDataVo.setType("0");
                        baseDataVo.setVoList(baseData);
                        baseDataVo.setOperationType("");
                        assetsDataVo.setLabelText("资产");
                        assetsDataVo.setType("0");
                        assetsDataVo.setVoList(assetsData);
                        assetsDataVo.setOperationType("");
                        supplierDataVo.setLabelText("供应商信息");
                        supplierDataVo.setType("0");
                        supplierDataVo.setVoList(supplierData);
                        supplierDataVo.setOperationType("");
                        paperFileDataVo.setLabelText("图纸");
                        paperFileDataVo.setType("2");
                        paperFileDataVo.setVoList(paperFileData);
                        paperFileDataVo.setOperationType("");
                        otherDataVo.setLabelText("其它");
                        otherDataVo.setType("0");
                        otherDataVo.setVoList(otherData);
                        otherDataVo.setOperationType("");
                        dataVos.add(baseDataVo);
                        dataVos.add(assetsDataVo);
                        dataVos.add(supplierDataVo);
                        dataVos.add(paperFileDataVo);
                        dataVos.add(equipmentDataVo);
                        dataVos.add(fixtureDataVo);
                        dataVos.add(otherDataVo);

                        Map resultMap = new HashMap<>();
                        resultMap.put("records", dataVos);
                        return Response.ok("", resultMap);
                    }
                }else if (ModuleServe.eqsSparePartRefModule.getValue().equals(moduleId)) {
                    JSONObject jsonObject = JSON.parseObject(json);
                    String id = jsonObject.getString("id");
                    EntityWrapper<EqsSparePart> entityWrapper = new EntityWrapper<>(EqsSparePart.class);
                    entityWrapper.eq("id", id);
                    EqsSparePart eqsSparePart = eqsSparePartService.getById(json);
                    List<DataVo> dataVos = new ArrayList<>();
                    DataVo applyDataVo = new DataVo();
                    List<DataVo> applyData = new ArrayList<DataVo>();//申请
                    if (eqsSparePart != null) {
                        //申请信息
                        String code = eqsSparePart.getCode();//工装编号
                        String locationCode = eqsSparePart.getLocationCode();//库位编号
                        String qualityCode = eqsSparePart.getQualityCode();//质检报告编码

                        DataVo codeVo = initDataVo("备件编号", code, "sparePartCode", "", "1", "", "", "", "");
                        DataVo locationCodeVo = initDataVo("库位编号", locationCode, "locationCode", "", "1", "", "", "", "");
                        DataVo applyNumberVo = initDataVo("数量", "", "applyNumber", "", "1", "", "", "", "");
                        DataVo qualityCodeVo = initDataVo("质检报告编码", qualityCode, "qualityCode", "", "1", "", "", "", "");
                        DataVo applyDateVo = initDataVo("申请时间", "", "applyDate", "", "1", "", "3", "", "");
                        DataVo applyTypeVo = initDataVo("申请类型", "", "applyType", "", "1", "", "1", "", "spareOperateApplyType");
                        applyData.add(codeVo);
                        applyData.add(locationCodeVo);
                        applyData.add(applyNumberVo);
                        applyData.add(qualityCodeVo);
                        applyData.add(applyDateVo);
                        applyData.add(applyTypeVo);

                        applyDataVo.setLabelText("操作申请");
                        applyDataVo.setType("0");
                        applyDataVo.setVoList(applyData);
                        applyDataVo.setOperationType("6");
                        dataVos.add(applyDataVo);
                    }
                    Map resultMap = new HashMap<>();
                    resultMap.put("records", dataVos);
                    return Response.ok("", resultMap);
                }
            }

            if (ModuleServe.personModule.getValue().equals(moduleId)) {
                User user = null;
                if (!StringUtils.isEmpty(json)) {
                    user = JSON.parseObject(json, User.class);
                }
                if (user != null) {
                    switch (method) {
                        case "getListPage":
                            return Response.ok(null, null);
                        case "add":
                            if (user.getPassword() == null) {
                                user.setPassword("");
                            }
                            userService.insertUser(user, request);
                            return Response.ok("添加成功");
                        case "update":
                            userService.insertOrUpdateUser(user, request);
                            return Response.ok("更新成功");
                        case "delete":
                            return Response.ok("删除成功");
                        case "getById":
                            break;
                        default:
                            break;
                    }
                }
            } else {

            }

        }

        return null;
    }

    @RequestMapping(value = "customAction", method = {RequestMethod.POST, RequestMethod.GET})
    public Response customAction(@RequestParam(value = "moduleId", required = false) String moduleId, @RequestParam(value = "actionCode", required = false) String actionCode, @RequestParam(value = "ids", required = false) String[] ids, @RequestParam(value = "json", required = false) String json,
                                 @RequestParam(value = "endTime", required = false) String endTime) {
        String message = "执行完成";
        Response response = new Response();
        actionCode = StringEscapeUtils.unescapeHtml(actionCode);
        if (StringUtils.isNotBlank(actionCode)) {
            JSONObject jsonObject = JSON.parseObject(actionCode);
            String code = jsonObject.getString("code");
            if ("createMaintenanceTask".equals(code)) {
                String timeFrame = jsonObject.getString("args1");
                String sysConfigCode = jsonObject.getString("args2");
                json = StringEscapeUtils.unescapeHtml(json);
                if (StringUtils.isNotBlank(endTime)) {
                    Long val_ = new Long(endTime);
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                    System.out.println(sdf.format(new Date(val_)));
                    endTime = sdf.format(new Date(val_));
                    eqsMaintenanceTaskService.createMaintenanceTask_(ids, endTime, sysConfigCode, json);
                } else {
                    eqsMaintenanceTaskService.createMaintenanceTask(ids, timeFrame, sysConfigCode, json);
                }
                return response.ok(message);
            } else if ("updateMaintenanceTaskStatus".equals(code)) {
                String status = jsonObject.getString("args1");
                EqsMaintenanceTask eqsMaintenanceTask = new EqsMaintenanceTask();
                eqsMaintenanceTask.setStatus(status);
                eqsMaintenanceTask.setExecutor(UserUtils.getUser().getRealname());
                eqsMaintenanceTask.setExecutorId(UserUtils.getUser().getId());
                eqsMaintenanceTask.setIds(ids);
                eqsMaintenanceTaskService.updateMaintenanceTask(eqsMaintenanceTask);
                return response.ok(message);
            } else if ("finshMaintenanceTask".equals(code)) {
                json = StringEscapeUtils.unescapeHtml(json);
//                JSONObject jsonObject_ = JSON.parseObject(json);
//                String checkId = jsonObject_.getString("checkId");
//                EqsMaintenanceCheck eqsMaintenanceCheck = new EqsMaintenanceCheck();
//                eqsMaintenanceCheck.setId(checkId);
//                EqsMaintenanceCheck check = eqsMaintenanceCheckService.getEqsMaintenanceCheck(eqsMaintenanceCheck);
//                return response.ok("", check);

                //保养任务完成
                EqsMaintenanceTask eqsMaintenanceTask = JSON.parseObject(json, EqsMaintenanceTask.class);
                eqsMaintenanceTask.setExecutor(UserUtils.getUser().getRealname());
                eqsMaintenanceTask.setExecutorId(UserUtils.getUser().getId());
                eqsMaintenanceTask.setStatus("1");
                eqsMaintenanceTask.setExecutionTime(new Date());
                eqsMaintenanceTaskService.insertOrUpdate(eqsMaintenanceTask);
                return response.ok(message);
            } else if ("assignMaintenanceTask".equals(code)) {
                json = StringEscapeUtils.unescapeHtml(json);
                EqsMaintenanceTask eqsMaintenanceTask = JSON.parseObject(json, EqsMaintenanceTask.class);
                String[] array = eqsMaintenanceTask.getGroupUserArray();
                String val = "";
                if (array != null && array.length > 0) {
                    for (String v : array) {
                        val = val + v + ",";
                    }
                }
                eqsMaintenanceTask.setGroupUserIds(val);
                eqsMaintenanceTaskService.insertOrUpdate(eqsMaintenanceTask);
                return response.ok(message);
            } else if ("confirmRepair".equals(code)) {
                String result = eqsRepairRequistionService.confirmRepair(ids);
                if ("exist".equals(result)) {
                    message = "维修单已存在";
                    return response.ok(message);
                } else if ("success".equals(result)) {
                    return response.ok(message);
                }
            }else if("createCheck".equals(code)){
                json = StringEscapeUtils.unescapeHtml(json);
                if (StringUtils.isNotBlank(endTime)) {
                    Long val_ = new Long(endTime);
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                    System.out.println(sdf.format(new Date(val_)));
                    endTime = sdf.format(new Date(val_));
                    eqsCheckService.createCheck(ids,endTime,json);
                }
            }
        }
        return response;
    }


    /**
     * 获取package的title
     *
     * @param packageId
     * @return
     */
    public String getPackageTitle(String packageId) {
        String title = "";
        UiPackageInfo search = new UiPackageInfo();
        search.setId(packageId);
        UiPackageInfo result = uiPackageInfoService.getUiPackageInfo(search);
        if (result != null) {
            title = result.getTitle();
        }
        return title;
    }

    /**
     * 根据配置code自动编码
     *
     * @param entityName
     * @param json
     * @return
     */
    public String getCode(String entityName, String json) {
        String autoCode = "";
        JSONObject jsonObject = JSON.parseObject(json);
        String code = jsonObject.getString("code");
        if (code != null) {
            if (StringUtils.isBlank(code)) {
                Class cla = null;
                try {
                    cla = Class.forName(entityName);
                    Object object = JSON.parseObject(json, cla);
                    Field[] fields = object.getClass().getDeclaredFields();
                    if (fields != null && fields.length > 0) {
                        for (Field field : fields) {
                            if ("code".equals(field.getName())) {
                                if (field.isAnnotationPresent(UiPropertyField.class)) {
                                    UiPropertyField annotation = field.getAnnotation(UiPropertyField.class);
                                    String codeConfig = annotation.codeConfig();
                                    if (StringUtils.isNotBlank(codeConfig)) {
                                        CodeTable codeTable = new CodeTable();
                                        codeTable.setCode(codeConfig);
                                        autoCode = codeTableService.createNewCode(codeTable);
                                    }
                                }
                                break;
                            }
                        }
                    }
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                }
                jsonObject.put("code", autoCode);
            }

        }
        return jsonObject.toString();
    }


    /**
     * 初始化DataVo
     *
     * @param title
     * @param data
     * @param dataType
     * @param dictGroupCode
     * @return
     */
    public DataVo initDataVo(String title, String data, String propertyName, String aliasName, String canDisplay, String isDisplayAsSearchResult, String dataType, String referenceModuleId, String dictGroupCode) {
        DataVo dataVo = new DataVo();
        dataVo.setLabelText(title);
        dataVo.setData(data);
        dataVo.setPropertyName(propertyName);
        dataVo.setAliasName(aliasName);
        dataVo.setCanDisplay(canDisplay);
        dataVo.setIsDisplayAsSearchResult(isDisplayAsSearchResult);
        dataVo.setDataType(dataType);
        dataVo.setReferenceModuleId(referenceModuleId);
        dataVo.setDictGroupCode(dictGroupCode);
        return dataVo;
    }


}
